package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileCopy {
    public static void main(String[] args) throws IOException {
        long l = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("a.txt");
        FileOutputStream fos = new FileOutputStream("c.txt");
        int len = 0;
        byte[] bytes = new byte[2];
        while ((len = fis.read(bytes)) != -1) {
            fos.write(bytes,0,len);
        }
        fos.write(12);
        fos.write(12);
        fos.write(12);
        fos.write(12);
        fos.write(12);

        fis.close();
        fos.close();
        long l1 = System.currentTimeMillis();
        System.out.println(l1-l);
    }
}
